<?php include('scripts.php'); ?>
<script>
$(function() {
    $("#registerForm").validate({
        rules : {
            "fullname" : {
                required : true,
                minlength : 2
            },
            "email" : {
                required : true
                , email: true
            },
            "contactNumber" : {
                required : true
                , minlength : 10
            }
        },
        submitHandler: function(form) {
            waiting();
            form.submit();
        },
        success: function(label) {
            //label.addClass("valid").text("Valid captcha!")
        }
    });
    $("#btnUpdate").button({
        icons: {
            primary: "ui-icon-disk"
        }
    });
});
</script>

<div style="padding: 10px; top: 30px; width: 98%">
    <ul class="tabs-nav" id="_tab">
        <li class="tabs-selected"><a href="/member/viewProfile" name="tab" rel="info"><span><?php echo __('Account Information'); ?></span></a></li>
        <li class="tabs-unselected"><a href="/member/loginPassword" name="tab" rel="pass"><span><?php echo __('Change Password'); ?></span></a></li>
        <li class="tabs-unselected"><a href="/member/transactionPassword" name="tab" rel="pass"><span><?php echo __('Change Trx Password'); ?></span></a></li>
    </ul>
    <div class="tabs-panel" style="width:565px; padding:10px 10px;">
        <h3><?php echo __('Account Information') ?></h3>
        <form id="registerForm" method="post" action="/member/updateProfile">
        <table cellpadding="3" cellspacing="3" border="0" width="100%" class="tablelist">
            <tr>
                <td colspan=2 align='center'>
                <?php if ($sf_flash->has('successMsg')): ?>
                    <div class="ui-widget">
                        <div style="margin-top: 20px; padding: 0 .7em;" class="ui-state-highlight ui-corner-all">
                            <p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-info"></span>
                            <strong><?php echo $sf_flash->get('successMsg') ?></strong></p>
                        </div>
                    </div>
                <?php endif; ?>
                </td>
            </tr>
            <tr>
                <td>
                    <table cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="200px" class="caption">
                                <span id="Label4"><strong><?php echo __('Sponsor ID') ?></strong></span>
                            </td>
                            <td class="value">
                                <input name="sponsorId" readonly="readonly" id="sponsorId" tabindex="1" size="30"
                                       value="<?php echo $sponsor->getDistributorCode() ?>"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="caption">
                                <span id="Label25"><strong><?php echo __('Sponsor Name') ?></strong></span>
                            </td>
                            <td class="value">
                                <input name="sponsorName" readonly="readonly" id="sponsorName" tabindex="2" size="30"
                                       value="<?php echo $sponsor->getFullname() ?>"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="caption">
                                <span id="Label13"><strong><?php echo __('Full Name') ?></strong></span>
                            </td>
                            <td class="value">
                                <input name="fullname" type="text" id="fullname" tabindex="5" size="30"
                                       value="<?php echo $distDB->getFullName() ?>"/>
                            </td>
                        </tr>

                        <tr>
                            <td class="caption" valign="top">
                                <span id="Label18"><strong><?php echo __('Email') ?></strong></span>
                            </td>
                            <td class="value">
                                <input name="email" type="text" id="email" tabindex="13" size="30"
                                       value="<?php echo $distDB->getEmail() ?>"/>
                            </td>
                        </tr>
                        <tr class="caption">
                            <td class="login_t74" valign="top">

                                <span id="Label19"><strong><?php echo __('Email') ?></strong></span>
                            </td>
                            <td class="value">
                                <input name="contactNumber" type="text" id="contactNumber" tabindex="14" size="30"
                                       value="<?php echo $distDB->getContact() ?>"/>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <button id="btnUpdate"><?php echo __('Update') ?></button>
                </td>
            </tr>
        </table>
        </form>
    </div>
</div>